package com.njwb.day15.zqzb.ios.io6;

import com.njwb.day15.zqzb.ios.util.Util;

import java.io.*;

public class DataInputStreamDemo {
    public static void main(String[] args) {
        DataInputStream dataInputStream =  null ;
        try {
            dataInputStream = new DataInputStream(new FileInputStream(new File("chapter02/src/dos.txt")));
            int age = dataInputStream.readInt();
            double score = dataInputStream.readDouble();
            System.out.println("age:"+age);
            System.out.println("score:"+score);
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            Util.closeResource(dataInputStream);
        }

    }
}
